﻿@model CmsAdminWorkflowActiveModel

@{
    Layout = "~/admin/Views/CmsWorkflow/WorkflowItemBase.cshtml";
}

@functions
{
    string DisplayNullableDates(DateTime? date)
    {
        return date.HasValue ?
            date.Value.ToString("dd/MM/yyyy") :
            "N/A";
    }
}

@section ApproveForm
{
<div id="cms-js-approve" class="b-form_fancybox">
	<h1 class="g-clear">
		<i class="b-icon b-icon_h b-icon_h_config"></i>
		<span class="b-overflow">
			I confirm that this information has been reviewed in accordance with marketing guidelines
		</span>  
	</h1>
    <form id="cms-js-approve-form" action="" method="post">
        <fieldset class="b-form">    
            <ol class="b-form__rows ul-reset g-clear">
                <li class="b-form__row g-clear">
            	    <label>Please add any additional comments to support approval at this stage</label>
                    <textarea name="Notes" cols="40" rows="10"></textarea>
                </li>
                <li class="b-form__row b-form__row_buttons g-clear">
        	        <button class="b-button b-button_small cms-js-workflow-action" id="cms-js-workflow-submit" name="Workflow" type="button" value="Workflow">Approve</button>
                    <button class="b-button b-button_small b-button_colour_grey cms-js-workflow-cancel" name="Cancel" type="button" value="Cancel">Cancel</button>
                </li> 
            </ol>
        </fieldset>
    </form>
</div>
}

@section RejectForm
{
<div id="cms-js-reject" class="b-form_fancybox">
	<h1 class="g-clear">
		<i class="b-icon b-icon_h b-icon_h_config"></i>
		<span class="b-overflow">
			The information requires changes to be made before it can be approved for marketing purposes
		</span>  
	</h1>
    <form id="cms-js-reject-form" action="" method="post">
        <fieldset class="b-form">    
            <ol class="b-form__rows ul-reset g-clear">
                <li class="b-form__row g-clear">
            	    <label>Please provide details of why you have rejected the content</label>
                    <textarea name="Notes" cols="40" rows="10"></textarea>
                </li>
                <li class="b-form__row b-form__row_buttons g-clear">
        	        <button class="b-button b-button_small b-button_colour_red cms-js-workflow-action" id="cms-js-workflow-reject" name="Workflow" type="button" value="Workflow">Reject</button>
                    <button class="b-button b-button_small b-button_colour_grey cms-js-workflow-cancel" name="Cancel" type="button" value="Cancel">Cancel</button>
                </li> 
            </ol>
        </fieldset>
    </form>
</div>
}

@section ButtonsBlock
{
<div class="b-form  b-form_bordered b-form_layout_separated b-form_theme_green">
    <div class="b-form__head">
        <ol class="b-form__rows ul-reset g-clear">
            <li class="b-form__row g-clear">
                <span>Type:</span>
                <span>@Model.EntityType</span>
            </li>
            <li class="b-form__row g-clear">
                <span>Cycle:</span>
                <span>@Model.Cycle.@Model.State</span>
            </li>
            <li class="b-form__row g-clear">
                <span>Content author:</span>
                <span>@Model.User</span>
            </li>
            <li class="b-form__row g-clear">                    
            </li>
            <li class="b-form__row g-clear">
                <span>Approval deadline:</span>
                <span>@DisplayNullableDates(Model.ApprovalDate)</span>
            </li>
        </ol>
    </div>
    <div class="b-form__body">
        <div class="b-form__content">
            <ol class="b-form__rows ul-reset g-clear">
                <li class="b-form__row g-clear">
                    @{Html.RenderPartial("WorkflowPresenter", Model.AvailableTransitions);}   		
                </li>
            </ol>
        </div>
    </div>
</div>
} 

